package com.edu.Controller;

import com.edu.entity.Book;
import com.edu.service.BookService;
import com.edu.service.impl.BookServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet(name = "BookServlet", value = "/BookServlet")
public class BookServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        List bookList=new ArrayList<Book>();
        BookService bs=new BookServiceImpl();
        String meg=request.getParameter("meg");
        System.out.println(meg);
        bookList=bs.queryBook();
        request.setAttribute("bookList",bookList);
        request.getRequestDispatcher("book.jsp").forward(request, response);
    }
}
